﻿<UserControl x:Class="ALiteTeam.PackageTracer.View.DeliveryOrderControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    d:DesignHeight="120" d:DesignWidth="420" 
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    xmlns:my="clr-namespace:ALiteTeam.PackageTracer.View" 
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
    xmlns:GalaSoft_MvvmLight_Command="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WP71">
    
    <i:Interaction.Triggers>
        <i:EventTrigger EventName="Loaded">
            <GalaSoft_MvvmLight_Command:EventToCommand
                            Command="{Binding InitializeCommand}" />
        </i:EventTrigger>
            <i:EventTrigger EventName="Tap">
                <GalaSoft_MvvmLight_Command:EventToCommand
                            Command="{Binding NavigateCommand}"/>
            </i:EventTrigger>
    </i:Interaction.Triggers>
    <toolkit:ContextMenuService.ContextMenu>
        <toolkit:ContextMenu>
            <toolkit:MenuItem Header="钉到桌面" Command="{Binding PinCommand}"/>
        </toolkit:ContextMenu>
    </toolkit:ContextMenuService.ContextMenu>
    <Grid x:Name="LayoutRoot">
        <Border Name="rectangle" Width="100" Height="100" Margin="0,5,0,0" HorizontalAlignment="Left" Background="{StaticResource PhoneAccentBrush}" VerticalAlignment="Top" />
        <TextBlock Name="lblDelveryName" Width="95" Height="30" Text="{Binding DisplayName}" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="5,5,0,0" TextAlignment="Center" FontWeight="Bold" />
        <TextBlock Name="lblTitle" Width="215" Height="30" Text="{Binding Title}" FontSize="24" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="105,0,0,0" FontWeight="Bold" FontStyle="Normal" />
        <TextBlock Name="lblLastUpdated" Width="100" Height="18" Text="{Binding StringFormat=\{0\}......, Path=LastUpdatedTip}" FontSize="15" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="320,12,0,0" FontStyle="Italic" TextAlignment="Right" />
        <TextBlock Name="lblOrderNo" Width="280" Height="25" Text="{Binding Path=OrderNo, StringFormat=运单号：\{0\}}" FontSize="20" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="105,30,0,0" />
        <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">
            <TextBlock Name="lblSimpleMessage" Width="Auto" Height="60" Text="{Binding Path=SummaryInfo}" FontSize="18" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="105,55,0,0"/>
        </ScrollViewer>
        <Image Width="50" Height="50" Name="imgDelete" Margin="370,40,0,0" HorizontalAlignment="Left" >
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Tap">
                    <GalaSoft_MvvmLight_Command:EventToCommand
                        PassEventArgsToCommand="True"
                        Command="{Binding DeleteCommand}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Image>
        <Image Width="80" Height="80" Name="imgRefresh" Margin="10,25,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
            <i:Interaction.Triggers>
                <i:EventTrigger EventName="Tap">
                    <GalaSoft_MvvmLight_Command:EventToCommand
                        PassEventArgsToCommand="True"
                        Command="{Binding RefreshCommand}" />
                </i:EventTrigger>
            </i:Interaction.Triggers>
        </Image>
    </Grid>
</UserControl>
